package com.xinqi.common.third.oss;

import com.xinqi.common.base.error.CommonErrors;
import com.xinqi.common.third.oss.cloud.AliYunOSSService;
import com.xinqi.common.third.oss.cloud.OssService;

/**
 * OSS工厂类
 *
 * @author linkai
 * @date 2023/2/18
 */
public final class OssFactory {

    public static OssService build(OssProperties config) {
        OssService oss;
        switch (config.getType()) {
            case ALI_YUN:
                oss = new AliYunOSSService(config);
                break;
            default:
                throw CommonErrors.NOT_FOUND.asException();
        }
        return oss;
    }

}
